﻿CREATE TABLE [dbo].[Station] (
    [Station_ID]        INT           IDENTITY (1, 1) NOT NULL,
    [Code]              VARCHAR (7)   NOT NULL,
    [FullCode]          VARCHAR (7)   NULL,
    [Name]              VARCHAR (100) NULL,
    [Mnemocode]         VARCHAR (10)  NULL,
    [MnemocodeEng]      VARCHAR (15)  NULL,
    [NameEng]           VARCHAR (110) NULL,
    [CTM_Country_ID]    CHAR (2)      CONSTRAINT [DF_Station_CTM_Country_ID] DEFAULT ('00' collate Cyrillic_General_CI_AS) NOT NULL,
    [CTM_Country_PP_ID] CHAR (2)      CONSTRAINT [DF_Station_CTM_Country_PP_ID] DEFAULT ('00' collate Cyrillic_General_CI_AS) NOT NULL,
    [Road_ID]           INT           CONSTRAINT [DF_Station_Road_ID] DEFAULT ((0)) NOT NULL,
    [Region_ID]         INT           CONSTRAINT [DF_Station_Region_ID] DEFAULT ((0)) NOT NULL,
    [IsRepairStation]   BIT           CONSTRAINT [DF_Station_IsRepairStation] DEFAULT ((0)) NOT NULL,
    [IsArriveStation]   BIT           CONSTRAINT [DF_Station_IsArriveStation] DEFAULT ((0)) NOT NULL,
    [IsDispatchStation] BIT           CONSTRAINT [DF_Station_IsDispatchStation] DEFAULT ((0)) NOT NULL,
    [IsUsed]            BIT           CONSTRAINT [DF_Station_IsUsed] DEFAULT ((0)) NOT NULL,
    [IsLocationStation] BIT           CONSTRAINT [DF_Station_IsLocationStation] DEFAULT ((0)) NOT NULL,
    [IsShipmentStation] BIT           CONSTRAINT [DF_Station_IsShipmentStation] DEFAULT ((0)) NOT NULL,
    [Country_PP_ID]     CHAR (2)      CONSTRAINT [DF_Station_Country_PP_ID] DEFAULT ('00' collate Cyrillic_General_CI_AS) NOT NULL,
    [MirrorStation_ID]  INT           NULL,
    CONSTRAINT [PK_Station] PRIMARY KEY CLUSTERED ([Station_ID] ASC),
    CONSTRAINT [UN_Station_Code] UNIQUE NONCLUSTERED ([Code] ASC),
    CONSTRAINT [UN_Station_FullCode] UNIQUE NONCLUSTERED ([FullCode] ASC)
);

